package sebastiankerckhof.helper;

import sebastiankerckhof.structure.math.Vector3f;

public class MathHelper {
	public static Vector3f[] createOrthoBase(Vector3f a, Vector3f b){
		Vector3f[] r = new Vector3f[3];
		r[0] = a.divide(a.length()); //w = a / ||a||
		r[1] = (b.crossProduct(r[0]));
		r[1] = r[1].divide(r[1].length()); //u = b x w / ||b x w||
		r[2] = r[0].crossProduct(r[1]); // v = u x w
		
		return r;
	}
}
